<script type="text/javascript" src="<?=url?>templates/js/customer_slider_top_carousel.js"></script>
<?php echo modules::run('banner/top');?>
<!------ sp ------->

<div class="tuvan"> 
    <!------ sp-left -------->
    <div class="tuvan-left">
        <?php
		$k=1;
		//$content=($lang=='vn')? 'content_vn' : 'lb_content_en';
		 foreach($list as $row){
		if(count($row->$content)>=1){
			 ?>
        <div class="item">
            <h2 class="item-title"><?php echo $k++;?>. 
            <a href="<?=site.'tu-van/detail/'.$row->id.'/'.kodau(str_limit($row->$content),100).'.html'?>"><?php echo $row->content_.$lg;?> </a></h2>
            <?php 
			$this->load->model('tuvan_model', 'tuvan') ;
			$arrGetList=$this->tuvan->get_all('tuvan',$per_page,0,$row->id,$lang);
			if(count($arrGetList)>0){
			foreach($arrGetList as $row2){?>
            <div class="item-content" style="margin-left:15px">- Trả lời: <?php echo $row2->$content?>.</div>
            <?php }}?>
        </div>
        <?php } }?>
        <div class="tuvan_cont_line"></div>
        <div class="lienhe tuvan_cont" style="width:405px">
            <div class="cont_left ">
                <div class="cont_title">
                    <?=lang('gui_cau_hoi')?>
                </div>
                <form id="frmcontacts_tuvan" name="frmcontacts" method="post" action="<?=base_url().$lang?>/tuvan/action">
                    <div class="contacts"> 
                        <!--<p>Gửi câu hỏi cần tư vấn.</p>-->
                        <ul>
                            <li class="left"><?=lang('ho_ten')?>:</li>
                            <li class="right"><input type="text" size="40" id="cusname" name="cusname" class="lhe"></li>
                        </ul>
                        <ul>
                            <li class="left">Email :</li>
                            <li class="right"><input type="text" size="40" id="cusmail" name="cusmail" class="lhe"></li>
                        </ul>
                        <ul>
                            <li class="left"><?=lang('noi_dung')?>:</li>
                            <li class="right"><textarea rows="7" style="width:350px" cols="35" id="noidung" name="noidung"></textarea></li>
                        </ul>
                        <ul>
                            <li><!--(*)Bắt buộc phải điền thông tin--> </li>
                            <li class="right" style="text-align:right;width:360px">
                                <input type="submit" value="<?=lang('btn_send')?>" id="btn_tuvan" name="btn_tuvan">
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!---end sp-left -----> 
    <!------ sp-right --------->
    <div class="tuvan-right">
        <div class="block">
        	<img class="img" src="<?=url.'templates/images/banner-rec-1.jpg'?>" width="300"> 
        	<img class="img" src="<?=url.'templates/images/banner-rec-2.jpg'?>" width="300">
        </div>
    </div>
    <!---- end sp-right------>
    <div class="clear"></div>
</div>
<!--- end sp -----> 
<script type="text/javascript">
$(document).ready(function(){
	$("#frmcontacts_tuvan").validate({
        rules: {
            cusmail: {
				required:true,
				email:true
			},
			noidung:"required",
        },
        messages: {
			cusmail: {
				required:"Vui lòng nhập nội dung email.",
				email:"Email không đúng định dạng."
			},
			noidung: "Vui lòng nhập nội dung câu hỏi vào.",
			//lb_image:{validateImage:"File ảnh không hợp lệ!",}
        }
    });

});
</script>